Feature: 用户中心
  作为一个律团普通用户
  我可以查看个人信息
  这样我就可以更好的管理自己的信息


Background:
Given http "authorization" header is "bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJzdWIiOjE1MDEsImlzcyI6Imh0dHA6XC9cLzE5Mi4xNjguMS40M1wvbG9naW4iLCJpYXQiOiIxNDUwMjM3Mzc1IiwiZXhwIjoiMTQ1MDI0MDk3NSIsIm5iZiI6IjE0NTAyMzczNzUiLCJqdGkiOiIzZGMyZjVkMzU3MzE4ODhkYzkxNWZjYjUwNGU4YjU1MCJ9.ZmIxOTE2MGJmNGI0YzlkNjA4ZDEzNWExNWIyY2E0OWNjZmJmM2UxMTJlZjJjODIzMjNlYjZmNDcxYzI5ZWE2Ng"
And http "accept" header is "application/json"


# 不成功的Scenarios

Scenario: 如果使用无效的token登录，系统会报错（所有的接口都要token）
Given I am on "/center/customer/info"
And the response is in "json" format
Then the response status code should be 401

# 测试普通用户成为律师

Scenario:普通用户成为律师时，提交的信息（realname、sex、province、city、district、address、avatar、licenselicense_file、ID_img、work_scope、company_name、practice_period、text_reply_fee、phone_reply_fee、position）不能有空，否则会报错（POST   _/center/become_lawyer_）

Scenario:普通用户成为律师时，提交的信息work_scope(array),否则会报错（POST   _/center/become_lawyer_）

Scenario:普通用户成为律师时，提交的信息practice_period(regex:/^(1to3|3to5|5to8|8to10|10)$/i),否则会报错（POST   _/center/become_lawyer_）

Scenario:普通用户成为律师时，提交的信息text_reply_fee(integer),否则会报错（POST   _/center/become_lawyer_）

Scenario:普通用户成为律师时，提交的信息phone_reply_fee(integer),否则会报错（POST   _/center/become_lawyer_）

Scenario:普通用户成为律师时，提交的信息position(regex:/^(junior_lawyer|senior_lawyer|partner)$/i),否则会报错（POST   _/center/become_lawyer_）

Scenario:普通用户成为律师时，提交的信息sex(regex:/^(male|female)$/i),否则会报错（POST   _/center/become_lawyer_）

# 测试普通用户更新用户信息

Scenario: 普通用户更新用户信息时，提交的信息phone（regex:/^1[3-8]\d{9}$/），否则会报错（POST _/center/update_phone_）（这个手机号已经注册了）（手机号格式不正确）

Scenario: 普通用户更新用户信息时，提交的正确的phonecode，否则会报错（手机验证码错误）（POST   _/center/update_phone_）

Scenario: 普通用户更新用户信息时，提交的信息email（regex:/../），否则会报错（POST   _/center/update_phone_）（这个邮箱已经注册了）（邮箱格式不正确）

# 测试修改密码

Scenario: 普通用户重置密码时，old_password、new_password、new_password_retype，不能为空，否则会报错（POST   _/center/reset_pass_）

Scenario: 普通用户重置密码时，old_password，需要真确的密码，否则报错（原始密码填写不正确）（POST   _/center/reset_pass_）

Scenario: 普通用户重置密码时，new_password，不能与原始密码一样，否则会报错（新密码不可以和旧密码一样）（POST   _/center/reset_pass_）

Scenario: 普通用户重置密码时，new_password，格式要正确，否则会报错（新密码格式不正确）（POST   _/center/reset_pass_）

Scenario: 普通用户重置密码时，new_password、new_password_retype要一致，否则会报错（请确保两次输入的新密码是一致的）（POST   _/center/reset_pass_）


# 成功的Scenarios

Scenario: 获取到用户的个人信息（GET   _/center/customer/info_）
Given I am on "/center/customer/info"
And the response is in "json" format
Then the response status code should be 200
And I got message "/center/customer/info" for field "path"
Scenario: 普通用户更新用户信息时，提交的信息正确，用户信息更新（POST   _/center/customer/info_）

Scenario: 普通用户提交的信息正确，用户成功申请为律师（POST   _/center/customer/become_lawyer_）
Given I am on "/center/customer/become_lawyer"
And the response is in "json" format
Then the response status code should be 200
And I got message "/center/customer/become_lawyer" for field "path"


# 测试普通用户更新用户信息

Scenario: 更新电话（POST   _/center/update_phone_）
            
Scenario: 更新邮箱（POST   _/center/update_email_）

Scenario: 更新密码（POST   _/center/reset_pass_）

# 我的咨询

Scenario: 获取到我的咨询,全部列表（GET   _/center/question/all_）
# 创建一些咨询，把咨询的状态改变成不同的状态，验证最后得到的列表里面包括了这些咨询。
 Given I am on "/center/question/all"
  And the response is in "json" format
  Then the response status code should be 200
  And I got message "/center/question/all" for field "path"

Scenario: 获取到我的咨询,未受理页面信息（GET   _/center/question/new_）
 Given I am on "/center/question/new"
  And the response is in "json" format
  Then the response status code should be 200
  And I got message "/center/question/new" for field "path"
Scenario: 获取到我的咨询,待确认页面信息（GET   _/center/question/replied_）
 Given I am on "/center/question/replied"
  And the response is in "json" format
  Then the response status code should be 200
  And I got message "/center/question/replied" for field "path"

Scenario: 获取到我的咨询,待评价页面信息（GET   _/center/question/waitforevaluation_）
 Given I am on "/center/question/waitforevaluation"
  And the response is in "json" format
  Then the response status code should be 200
  And I got message "/center/question/waitforevaluation" for field "path"

Scenario: 咨询律师（POST   _/question/{id}/ask_）

Scenario: 获取到我的咨询,已完成页面信息（GET   _/center/question/complete_）
 Given I am on "/center/question/complete"
  And the response is in "json" format
  Then the response status code should be 200
  And I got message "/center/question/complete" for field "path"
Scenario: 对咨询进行评价（POST   _/question/{id}/to_evaluate_）

# 我的律师

Scenario: 获取到我的律师,已咨询页面信息（GET   _/center/lawyer/consulted_）
 Given I am on "/center/lawyer/consulted"
  And the response is in "json" format
  Then the response status code should be 200
  And I got message "/center/lawyer/consulted" for field "path"

Scenario: 获取到我的律师,已关注页面信息（GET   _/center/mylawyer/followed_）
 Given I am on "/center/mylawyer/followed"
  And the response is in "json" format
  Then the response status code should be 200
  And I got message "/center/mylawyer/followed" for field "path"

# 我的收藏

Scenario: 获取到我的收藏页面信息（GET   _/center/collect_）
 Given I am on "/center/collect"
  And the response is in "json" format
  Then the response status code should be 200
  And I got message "/center/collect" for field "path"

# 我的积分

Scenario: 获取到我的积分页面信息（GET   _/center/score/list_scores_）
 Given I am on "/center/score/list_scores"
  And the response is in "json" format
  Then the response status code should be 200
  And I got message "/center/score/list_scores" for field "path"

# 我的订单

Scenario: 获取到我的订单页面信息（GET   _/center/order_）
 Given I am on "/center/order"
  And the response is in "json" format
  Then the response status code should be 200
  And I got message "/center/order" for field "path"

# 我的评论
# 我的关注
# 修改密码
